<style type="text/css">
article,
body,
div,
footer,
h1,
h2,
h3,
header,
html,
li,
main,
p,
section,
span,
ul {
  padding: 0;
  margin: 0;
}

body {
  -webkit-font-smoothing: antialiased;
}

li {
  list-style: none;
}

img {
  border: 0;
}

a {
  outline: none;
  color: #8590a7;
}

a,
a:hover {
  text-decoration: none;
}

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

body {
  font-family: PingFang SC, Source Sans Pro, Hiragino Sans GB, Helvetica Neue,
    Helvetica, Microsoft Yahei, arial, sans-serif;
  color: #333;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

.text-center {
  text-align: center;
}

.content-wrap {
  width: 75%;
  padding: 10px;
}

.content-wrap .header {
  position: relative;
  font-weight: 700;
  border-bottom: 1px solid #ddd;
}

.input-img-code,
.input-password,
.input-text {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  padding-left: 40px;
  border: 0;
  border-bottom: 1px solid #ccc;
  width: 100%;
  height: 34px;
  padding-bottom: 4px;
  line-height: 30px;
  outline: none;
  font-size: 14px;
}

.input-img-code:focus,
.input-password:focus,
.input-text:focus {
  border-bottom: 2px solid #1b93fb;
}

.input-button {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-border-radius: 20px;
  border-radius: 20px;
  background-color: #1b93fb;
  border: 1px solid #1b93fb;
  width: 100%;
  height: 40px;
  outline: none;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
}

.input-button:active,
.input-button:hover {
  background-color: #1b7cfa;
  border-color: #1b7cfa;
}

.input-button.disable {
  background-color: #7fc2fd;
  border-color: #7fc2fd;
}

.scroll-wrapper {
  overflow: auto;
}

.scroll-wrapper::-webkit-scrollbar {
  width: 4px;
}

.scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: #62a3eb;
  -webkit-border-radius: 2px;
  border-radius: 2px;
}

#app {
  position: relative;
  margin: 0 auto;
  color: #2c3e50;
  width: 630px;
  min-height: 460px;
  font-size: 14px;
  overflow: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
  -webkit-perspective-origin: 50%;
  perspective-origin: 50%;
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-transition: width 0.2s linear;
  -o-transition: width 0.2s linear;
  transition: width 0.2s linear;
}

#app.features-root {
  width: 600px;
}

#app::-webkit-scrollbar {
  width: 2px;
}

#app::-webkit-scrollbar-thumb {
  background-color: #1e7be2;
}

.app-view {
  -webkit-transition: all 0.1s linear;
  -o-transition: all 0.1s linear;
  transition: all 0.1s linear;
}

.app-transition-enter,
.app-transition-leave-active {
  opacity: 0;
  -webkit-transform: translate3d(100px, 0, 0);
  transform: translate3d(100px, 0, 0);
}

.app-transition-enter.main-page,
.app-transition-leave-active.main-page {
  opacity: 0.5;
  -webkit-transform: translateZ(-20px);
  transform: translateZ(-20px);
}

.app-transition-enter.features-page,
.app-transition-leave-active.features-page {
  opacity: 0;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
</style>
<style type="text/css">
:after,
:before {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.main-view {
  -webkit-transition: opacity 0.1s linear;
  -o-transition: opacity 0.1s linear;
  transition: opacity 0.1s linear;
}

.main-transition-enter,
.main-transition-leave-active {
  opacity: 0.4;
}

.mask {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: hsla(0, 0%, 100%, 0.4);
  z-index: 1000;
}

.container {
  overflow: hidden;
}

.main-top,
main {
  position: relative;
}

.main-top {
  background: #fff;
  height: 50px;
  line-height: 50px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  border-bottom: 1px solid #ebeef5;
}

.main-top .menu-list {
  height: 50px;
  text-align: center;
  font-size: 0;
}

.main-top li {
  width: 25%;
  display: inline-block;
  text-align: center;
  color: #c2cfdf;
  font-size: 12px;
}

.main-top li:last-child a:after {
  display: none;
}

.main-top a {
  display: inline-block;
  position: relative;
  color: #c2cfdf;
  height: 100%;
  width: 100%;
}

.main-top a span {
  margin-left: 12px;
  vertical-align: middle;
}

.main-top a:before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 20px;
  vertical-align: middle;
}

.main-top a.active,
.main-top a:hover {
  text-decoration: none;
  color: #519fff;
}

.main-top a.has-notif span {
  display: inline-block;
}

.main-top a.has-notif span:after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #fb3131;
  -webkit-border-radius: 3px;
  border-radius: 3px;
  position: absolute;
  top: 14px;
  left: 33px;
}

.main-top .tool:before {
  background: url()
    no-repeat 50%;
  -webkit-background-size: contain;
  background-size: contain;
}

.main-top .tool.active:before,
.main-top .tool:hover:before {
  background: url()
    no-repeat 50%;
  -webkit-background-size: contain;
  background-size: contain;
}

.main-top .account:before {
  background: url()
    no-repeat 50%;
  -webkit-background-size: contain;
  background-size: contain;
}

.main-top .account.active:before,
.main-top .account:hover:before {
  background: url()
    no-repeat 50%;
  -webkit-background-size: contain;
  background-size: contain;
}

.main-top .msg:before {
  background: url()
    no-repeat 50%;
  -webkit-background-size: contain;
  background-size: contain;
}

.main-top .msg.active:before,
.main-top .msg:hover:before {
  background: url()
    no-repeat 50%;
  -webkit-background-size: contain;
  background-size: contain;
}

.main-top .set:before {
  background: url()
    no-repeat 50%;
  -webkit-background-size: contain;
  background-size: contain;
}

.main-top .set.active:before,
.main-top .set:hover:before {
  background: url()
    no-repeat 50%;
  -webkit-background-size: contain;
  background-size: contain;
}

.main-container {
  background-color: #fff;
  height: 100%;
  position: relative;
}

.xmt-model {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  background-color: #000;
  z-index: 99;
}

.xmt-update-tip {
  position: absolute;
  z-index: 100;
  background: #fff;
  -webkit-border-radius: 4px;
  border-radius: 4px;
  width: 230px;
  height: 330px;
  top: 50%;
  left: 50%;
  margin-left: -155px;
  margin-top: -185px;
  text-align: center;
  padding: 20px 40px;
}

.xmt-update-tip img {
  width: 70%;
}

.xmt-update-tip .update-content {
  text-align: left;
  margin: 10px 0;
  height: 150px;
  overflow: auto;
}

.xmt-update-tip .update-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: #000;
  line-height: 30px;
}

.xmt-update-tip .update-content ol {
  width: auto !important;
  padding: 0;
  padding-left: 18px;
  margin: 0;
}

.xmt-update-tip .update-content li {
  color: #333;
  list-style: decimal;
  line-height: 30px;
  margin-left: 0;
}

.xmt-update-tip .update-content::-webkit-scrollbar {
  width: 0;
}

.xmt-update-tip .update-content::-webkit-scrollbar-thumb {
  background-color: #62a3eb;
  -webkit-border-radius: 2px;
  border-radius: 2px;
}

.xmt-update-tip .update-content::-webkit-scrollbar-track {
  border: 0 solid #eee;
}

.xmt-update-tip .update-btn {
  display: inline-block;
  width: 160px;
  height: 36px;
  background: #f2b844;
  font-size: 16px;
  color: #fff;
  line-height: 36px;
  -webkit-border-radius: 18px;
  border-radius: 18px;
  cursor: pointer;
  margin-top: 10px;
}

.xmt-update-tip .update-close {
  background-color: #fff;
  background-image: url();
  background-repeat: no-repeat;
  -webkit-background-size: 10px 10px;
  background-size: 10px;
  background-position: 50%;
  position: absolute;
  top: -10px;
  right: -10px;
  height: 22px;
  width: 22px;
  display: inline-block;
  -webkit-border-radius: 11px;
  border-radius: 11px;
  cursor: pointer;
}
</style>
<style type="text/css">
.main-content.main-content_tastehall {
  overflow: initial;
}

a {
  color: inherit;
}

.placeHolder {
  height: 89px !important;
  width: 89px !important;
  background-color: #fff !important;
  border: 1px dashed #519fff !important;
}

.platform-list,
.platforms-wrap {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  text-align: center;
}

.platform-list {
  position: relative;
  overflow: auto;
  height: 484px;
}

.platform-list::-webkit-scrollbar {
  width: 4px;
}

.platform-list::-webkit-scrollbar-thumb {
  background-color: #62a3eb;
  -webkit-border-radius: 2px;
  border-radius: 2px;
}

.platform-list .category {
  position: relative;
  margin-top: -1px;
  overflow: hidden;
  height: auto;
}

.platform-list .category.collapsed .category-bar .collapse-btn {
  border-top: 6px solid transparent;
  border-bottom: 6px solid #d8d8d8;
  top: -8px;
}

.platform-list .category.collapsed ul {
  height: 0 !important;
}

.platform-list .category .category-bar {
  position: relative;
  height: 24px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  line-height: 16px;
  padding: 4px 0 4px 10px;
  font-size: 12px;
  border-top: 1px solid #ebeef5;
  border-bottom: 1px solid #ebeef5;
  background-color: #f2f5fa;
  text-align: left;
  color: #8590a7;
}

.platform-list .category .category-bar .collapse-btn {
  position: absolute;
  top: -2px;
  right: 0;
  display: inline-block;
  margin: 10px 15px;
  float: right;
  border: 6px solid transparent;
  border-top: 6px solid #d8d8d8;
  cursor: pointer;
}

.platform-list .category ul {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  width: 660px;
  -webkit-transition: height 0.15s;
  -o-transition: height 0.15s;
  transition: height 0.15s;
}

.th-platform-item {
  display: table;
  width: 90px;
  float: left;
  height: 90px;
  border-right: 1px solid #f8f8f8;
  border-bottom: 1px solid #f8f8f8;
  text-align: center;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  cursor: pointer;
  color: #8590a7;
  font-size: 12px;
}

.th-platform-item .platform-item-info {
  display: table-cell;
  vertical-align: middle;
  position: relative;
  overflow: hidden;
}

.th-platform-item .platform-item-info .hot-tag {
  position: absolute;
  top: 3px;
  left: 2px;
  width: 25px;
}

.th-platform-item .platform-item-info .new-tag {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 35px;
}

.th-platform-item:hover {
  background-color: #f2f9ff;
}

.th-platform-item .platform-logo {
  width: 30px;
  margin-bottom: 10px;
  position: relative;
}

.vote-link {
  width: 50%;
  line-height: 130px;
  float: left;
  display: inline-block;
  text-align: center;
  cursor: pointer;
  color: #1b93fb;
  text-decoration: none;
}

.vote-link:hover {
  text-decoration: underline;
}

#taste-item_shop .platform-logo {
  -webkit-transform: rotateY(0deg);
  transform: rotateY(0deg);
}

#taste-item_shop.active .platform-logo {
  -webkit-transition: -webkit-transform 0.4s linear;
  transition: -webkit-transform 0.4s linear;
  -o-transition: transform 0.4s linear;
  transition: transform 0.4s linear;
  transition: transform 0.4s linear, -webkit-transform 0.4s linear;
  -webkit-transform: rotateY(1turn);
  transform: rotateY(1turn);
  -webkit-animation: shopAnim 0.4s cubic-bezier(0, 0.38, 1, 0.61);
  animation: shopAnim 0.4s cubic-bezier(0, 0.38, 1, 0.61);
}

.func-search {
  position: relative;
  padding: 15px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
}

.func-search .search {
  width: 426px;
  display: inline-block;
  background: #f4f8fb;
  padding: 0 5px;
}

.func-search .search-change {
  width: 248px;
}

.func-search .search-list {
  position: absolute;
  top: 50px;
  width: 90px;
  padding: 1px;
  background: #fff;
  -webkit-box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.14);
  box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.14);
  z-index: 99;
}

.func-search .search-list li {
  height: 30px;
  line-height: 30px;
  color: #8590a7;
  font-size: 12px;
  cursor: pointer;
}

.func-search .search-list li:hover {
  background: #f2f9ff;
}

.func-search .search-list li:before {
  content: "";
  display: inline-block;
  height: 16px;
  width: 16px;
  vertical-align: middle;
  margin-right: 5px;
  margin-top: -2px;
}

.func-search .search-list li span {
  display: inline-block;
}

.func-search .search-list .sogou:before {
  background: url()
    no-repeat;
  -webkit-background-size: contain;
  background-size: contain;
}

.func-search .search-list .toutiao:before {
  background: url()
    no-repeat;
  -webkit-background-size: contain;
  background-size: contain;
}

.func-search .search-list .zhihu:before {
  background: url()
    no-repeat;
  -webkit-background-size: contain;
  background-size: contain;
}

.func-search .search-list .weibo:before {
  background: url()
    no-repeat;
  -webkit-background-size: contain;
  background-size: contain;
}

.func-search .search-list .qq:before {
  background: url()
    no-repeat;
  -webkit-background-size: contain;
  background-size: contain;
}

.func-search .search-list .baidu:before {
  background: url()
    no-repeat;
  -webkit-background-size: contain;
  background-size: contain;
}

.func-search .search-type {
  cursor: pointer;
  display: inline-block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  float: left;
}

.func-search .search-type:after {
  content: "";
  margin-left: 5px;
  display: inline-block;
  width: 8px;
  height: 16px;
  background: url()
    no-repeat 50%;
  -webkit-background-size: cover;
  background-size: cover;
  vertical-align: middle;
}

.func-search .search-type img {
  vertical-align: middle;
  width: 16px;
  height: 16px;
}

.func-search input {
  border: none;
  height: 30px;
  width: 324px;
  background: #f4f8fb;
  padding-left: 10px;
  outline: none;
  font-size: 12px;
  vertical-align: top;
  float: left;
}

.func-search .input-change {
  width: 195px;
}

.func-search ::-webkit-input-placeholder {
  color: #c2cfdf;
}

.func-search a {
  float: right;
  cursor: pointer;
  display: inline-block;
  height: 30px;
  width: 72px;
  line-height: 30px;
  text-align: center;
  vertical-align: top;
}

.func-search .num {
  -webkit-border-top-right-radius: 2px;
  border-top-right-radius: 2px;
  -webkit-border-bottom-right-radius: 2px;
  border-bottom-right-radius: 2px;
  color: #fff;
}

.func-search .sg {
  background: #519fff;
}

.func-search .sg:hover {
  background-color: #40a9ff;
}

.func-search .tt {
  background: #f75856;
}

.func-search .tt:hover {
  background: #ea2826;
}

.func-search .zh {
  background: #24a2fa;
}

.func-search .zh:hover {
  background: #0b90ed;
}

.func-search .wb {
  background: #ff8140;
}

.func-search .wb:hover {
  background: #f0590c;
}

.func-search .ql {
  background: #ff6428;
}

.func-search .ql:hover {
  background: #f24e0f;
}

.func-search .bd {
  background: #38f;
}

.func-search .bd:hover {
  background: #0a6bf3;
}

.func-search .article {
  margin-left: 10px;
  border: 1px solid #ccc;
  height: 28px;
  line-height: 28px;
  width: 70px;
  color: #8590a7;
  -webkit-border-radius: 2px;
  border-radius: 2px;
}

.func-search .article:hover {
  background-color: #f5f5f5;
}

@-webkit-keyframes shopAnim {
  0% {
    top: 0;
  }
  50% {
    top: -10px;
  }
  to {
    top: 0;
  }
}

@keyframes shopAnim {
  0% {
    top: 0;
  }
  50% {
    top: -10px;
  }
  to {
    top: 0;
  }
}
</style>
<template>
  <div id="app" class="taste-hall-root" style="height:600px;">
    <div class="container main-page app-view">
      <div class="mask"></div>
      <div>
        <tags-nav :currentNav="currentNav" />
        <main>
          <div class="main-container">
            <div
              class="main-content main-content_tastehall platforms-wrap main-view"
              results=""
              unread_message="4"
              update_url=""
            >
              <div class="func-search">
                <div class="search">
                  <input
                    type="text"
                    v-model="keyword"
                    placeholder="搜索导航"
                    name="keyword"
                    autocomplete="off"
                    class=""
                  />
                </div>
                <a class="num sg" @click="handleSearch">搜导航</a>
              </div>
              <div class="platform-list">
                <div
                  v-for="(nav, index) in navList"
                  :class="
                    nav.showContent === true ? 'category' : 'category collapsed'
                  "
                >
                  <div class="category-bar">
                    {{ nav.name }}
                    <i class="collapse-btn" @click="changeContent(index)"></i>
                  </div>
                  <ul style="" v-if="nav.showContent === true">
                    <li
                      class="th-platform-item"
                      id="btn"
                      v-for="info in nav.lists"
                    >
                      <div class="platform-item-info">
                        <a
                          :href="info.url"
                          target="_blank"
                          style="color:#8590a7;"
                        >
                          <img :src="info.icon" class="platform-logo" />
                        </a>
                        <a
                          :href="info.url"
                          target="_blank"
                          style="color:#8590a7;"
                        >
                          <p class="platform-name">
                            {{ info.name }}
                          </p>
                        </a>
                        <img
                          src="../../../images/left-new.png"
                          class="new-tag"
                          v-if="info.isNew === 1"
                        />
                        <img
                          src="../../../images/right-tuijian.png"
                          class="hot-tag"
                          v-if="info.isRecommend === 1"
                        />
                      </div>
                    </li>
                  </ul>
                </div>
                <Spin size="large" fix v-if="spinShow"></Spin>
              </div>
            </div>
          </div>
        </main>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      navList: [
        {
          id: 1,
          name: "测试",
          showContent: true,
          lists: [
            {
              id: 2,
              name: "测试",
              url: "http://www.baidu.com",
              icon: "http://qcybnir4u.bkt.clouddn.com/saas.png",
              isNew: 1,
              isRecommend: 1
            }
          ]
        }
      ],
      currentNav: "home",
      keyword: "",
      spinShow: false,
      username: ""
    };
  },
  mounted() {
    this.getNavigationList();
  },
  methods: {
    development() {
      this.$Message.warning("正在开发中，敬请期待！");
    },
    changeContent(index) {
      this.navList[index].showContent = !this.navList[index].showContent;
      console.log(this.navList);
    },
    // 搜索
    handleSearch() {
      this.spinShow = true;
      this.getNavigationList(this.keyword);
    },
    getNavigationList() {
      console.log("username");
      // TODO 获取cookie信息
      // chrome.cookies.get({ url: this.$config.apiUrl, name: 'username' }, async cookie => {
      //     console.log(cookie)
      //     if(cookie) {
      //         this.username = cookie.value
      //         console.log('token: ' + cookie.value)
      //     }
      // })
      // console.log(this.username)
      // TODO 获取导航信息
      // this.$http.post('nav/lists', {keyword: this.keyword})
      // .then(response => {
      //     const { data, status } = response
      //     if (status === 200) {
      //         console.log(data.errcode)
      //         console.log(status)
      //         console.log(data)
      //         if (data.errcode === 0) {
      //             this.navList = data.data
      //             this.spinShow = false
      //         } else {
      //             this.$Message.error(data.errmsg)
      //         }
      //     } else {
      //         this.$Message.error("服务开小差，请稍后再试！")
      //     }

      // })
      // .catch(error => {
      // 	console.log(error)
      // })
    }
  }
};
</script>
